GBML manual / Tile Animation

tile_anim_pause

Pauses (paused = true) or resumes (false) every animated tile group belonging to tileset at once.

Works differently on Game Boy - An animated tile on the Game Boy takes one of the picture's 192 tiles to itself, and one shown mirrored gets a stored copy, one more tile. Its frames use the 4 shades; a color cycle turns only when its shades are its own.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

tile_anim_pause(tileset, paused)

Arguments

NameType
tilesettileset
pausedbool

Returns

Nothing.

Description

Pauses or resumes every animated tile group belonging to one tileset at once - the whole tileset's worth of cycling tiles freeze on whichever frame they were showing (paused = true), or pick back up from there (paused = false). Unlike tile_anim_frame, this affects every group on the tileset together; there is no per-group pause. See Tile animation for what a group actually is and how one is set up in the Paint tab (on a tileset you paint rooms from, or on a whole-picture background).

You do not need this to freeze the tiles for a pause menu: a paused game holds its animated tiles still by itself, because Project Settings has a box, Stop animations on pause, and it is ticked in every project. This call is for stopping a tileset at other times, or for a game that unticked that box.

A tileset that is already in the requested state is a harmless no-op either way, and so is pausing a tileset this project never animated at all - there is no need to guard the call with a check first.

Example

tile_anim_pause(ts_doc_dungeon, game_paused());

Holds the dungeon tileset's animated tiles (torches, water) still while the game is paused. With Stop animations on pause ticked the game does that for you, so this line is only needed if you unticked it.

On the GBA

A tileset not currently paused/resumed is a no-op either way (idempotent); pausing one this project never animated at all is harmless too.

See also: tile_anim_frameTile animation